package com.jzy.stock.wareHoursePosition.mapper;


import com.jzy.stock.kufangguishu.model.KuWeiVo;
import com.jzy.stock.wareHoursePosition.model.*;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface WareHoursePositionMapper {

    List<WareHoursePositionVo> queryData(SelectVo SelectVo);

    int queryCount(SelectVo SelectVo);


    void add(ListVo contentList);

    @Select("select id,name,code from kuwei where code = #{code}")
    IwnXiaLaVo queryByCode(String code);

    @Select("select * from kuwei where id = #{id}")
    WareHoursePositionVo queryById(Integer id);

    @Update("update kuwei set name = #{name} where id = #{id}")
    void update(WareHoursePositionVo WareHoursePositionVo);

    @Update("update kuwei set status=#{status} where id =#{id}")
    void updateEnabled(WareHoursePositionVo WareHoursePositionVo);

/*    @Select("select * from stockroom")
    List<WareHouseVo> queryXiaLaWareHouse();*/

    @Select("select * from reservoir_area ra left join stockroom sk on ra.wareHouseCode = sk.code  where sk.id = #{id} ")
    List<StorageSectionVo> queryXiaLaStorageSectionVo(@Param("id") Integer id);

    @Select("SELECT kw.id id,kw.code code,kw.name name from kuwei kw\n" +
            "LEFT JOIN reservoir_area ra on kw.storageSectionCode=ra.`code`\n" +
            "LEFT JOIN stockroom sk on sk.`code`=ra.wareHouseCode\n" +
            "where sk.`id`=#{wareHouseId} and ra.`id`=#{storageSectionId}")
    List<StorageSectionVo> queryStorageBin(IwnVo iwnVo);

    List<LegalPersonVo> queryLegalPersonNameByUserId(int id);

    @Delete("delete from kuwei where storageSectionCode =#{storageSectionCode}")
    void delete(String storageSectionCode);

    List<KuWeiVo> queryAllKuwei();

    List<String> queryByNames(@Param("nameList") List<String> nameList);

    List<String> queryByCodes(@Param("codeList")List<String> codeList);

    List<String> queryByStorageSectionCodes(@Param("storageSectionCodeList")List<String> storageSectionCodeList);

    void importFile(@Param("importVoList")List<ImportVo> importVoList);

    List<String> queryByLegalPersonCodes(@Param("legalPersonCodeList")List<String> legalPersonCodeList);

    List<WareHoursePositionVo> queryDataExport(SelectVo selectVo);
}
